package com.technology.education.ui.common.withdraw_detail

import androidx.lifecycle.MutableLiveData
import com.technology.education.data.model.WithdrawOrderDetailModel
import com.technology.education.network.apiService
import me.hgj.jetpackmvvm.base.viewmodel.BaseViewModel
import me.hgj.jetpackmvvm.ext.request
import me.hgj.jetpackmvvm.state.ResultState

/**
 *@author:create by BZY
 *Date: 2022/2/28 17
 *  type 0 为教师申请退回保证金,保证金金额固定不能修改
 * 1 教师积分提现
 * 2 学生积分提现
 * 3 推广人员余额提现
 * 4 教师时长提现
 * 5.学生积分兑换时长
 */
class WithDrawDetailViewModel : BaseViewModel() {
    var id: String = ""
    var type = 0
    val result = MutableLiveData<ResultState<WithdrawOrderDetailModel>>()

    override fun getData() {
        super.getData()
        when(type){
            0,1,4-> request({ apiService.pointWithdrawDetailTeacher(id)},result)
            2->request({ apiService.pointWithdrawDetail(id) }, result)
            3->request({ apiService.withdrawDetail(id)},result)
        }

    }
}